package com.qxglxt.qxglxt.model;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

import org.hibernate.annotations.GenericGenerator;
import lombok.Data;

@Data
@Entity
@Table
@GenericGenerator(name = "jpa-uuid",strategy = "uuid")
public class Modules {

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(length = 32)
    private String id;//模块编号
    private String name;//模块名称
    private Integer parentId;//父模块编号
    private String path;//模块路径
    private String weight;//权重
    private String reservstion;//预留字符串字段
    private String remark;//预留整数字段

     //角色权限
     @JsonIgnore
     @ManyToMany(cascade = CascadeType.REFRESH,mappedBy = "modulesList",fetch = FetchType.LAZY)
     private List<Roles> rolesList;
}